{% extends 'cdserver/base.html' %}
{% load static %}

{% block content %}
    <h3>{% block page_title %}{% endblock %}</h3>
    {# 表格内容区 #}
    {#   按钮   #}
    <nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Left side -->
        {% block no_button %}
        <a class="btn btn-primary navbar-btn" href="{% block create_url %}{% endblock %}">
            {% block new_button %}
            {% endblock%}
        </a>
        {% endblock %}

        <!-- Right side -->
        <div class="navbar-right navbar-form">
            <div class="form-group">
                <input class="form-control" type="text" placeholder="Find a post">
                <button class="btn btn-primary" type="submit">Search</button>
            </div>
        </div>
    </div>
    </nav>
    <br>
    {#   面板    #}
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">
            <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
            {% block list_name %}
            发布服务器列表
            {% endblock %}
        </div>

        <!-- Table -->
        <table class="table is-fullwidth is-bordered is-striped is-hoverable has-text-centered">
            <thead>
            <tr>
                {% block list_items %}
                <th>ID</th>
                <th>产品名称</th>
                <th>发行版本</th>
                <th>创建时间</th>
                <th>状态</th>
                <th>操作</th>
                {% endblock %}
            </tr>
            </thead>
            <tbody>
            {% block queryset_list %}
            {% for obj in queryset %}
                <tr>
                    <th> {{ obj.id }} </th>
                    <td> {{ obj.product.product_name }}</td>
                    <td> {{ obj.release_version }} </td>
                    <td> {{ obj.create_time|date:"Y-m-d" }} </td>
                    <td> <span class="tag is-info is-light">{{ obj.get_status_display}}</span> </td>
                    <td>
                        <a class="view button is-link is-small" href="/{{ entity }}/{{ obj.id }}"> 查 看 </a>
                        <a class="edit button is-primary is-small" href="/{{ entity }}/{{ obj.id }}/edit"> 编 辑 </a>
                        <a class="del button is-danger is-small" href="/{{ entity }}/{{ obj.id }}/delete"> 删 除 </a>
                    </td>
                </tr>
            {% endfor %}
            {% endblock queryset_list %}
            </tbody>
        </table>
    </div>
{% endblock content %}

{% block footer %}
    <div class="container">
        {#  分页  #}
        <nav class="pagination is-rounded" role="navigation" aria-label="pagination">
            {{ page_string }}
        </nav>
    </div>
    <div class="mt-5"></div>
{% endblock %}

